<template>
  <div class="hadle">
    <ul >
      <li v-for="item,index in infor" :key="index" @click="fun(index)">
        <a>{{item.name}}</a>
        <div class="kuai" :class="block==index?'active':''"></div>
      </li>
    </ul>
  </div>
</template>
<script>
import { reactive,ref } from 'vue';
export default {
  name:'nav_i',
  setup() {
    let infor=reactive([
      {
        name:'关注'
      },
      {
        name:'发现'
      },
      {
        name:'同城'
      },
      {
        name:'热贴'
      },
      {
        name:'热聊'
      },
      {
        name:'热圈'
      },
    ])
    let block=ref(1)
    function fun(index){
      block.value=index
    }
    return{
      fun,
      infor,
      block
    }
  },
};
</script>

<style lang="less" scoped>
a{
  cursor: pointer;
}
.hadle {
  width: 21.1875rem;
  height: 3.125rem;
  padding: 0 2.375rem;
  margin: auto;
  white-space: nowrap;
  overflow-x: scroll;
  overflow-y: hidden;
  background-color: #ffffff;
}
ul {
  width: 21.1875rem;
  display: flex;
  justify-content: space-between;
}
.hadle::-webkit-scrollbar {
  display: none;
}
li {
  list-style-type: none;
  display: inline-block;
  font-size: 1.25rem;
  color: #000000;
  font-weight: bold;
  font-family: "Ping Fang  SC  Bold";
  a {
    color: #000000;
  }
}
 .kuai {
  position: absolute;
  display: none;
  margin-top: .3125rem;
  margin-left: -6px;
  width: 2.875rem;
  height: .3125rem;
  border-radius: .125rem;
  background-color: #fb4679;
}
.kuai.active{
  display: block;
}
</style>